package club.tianff.ulogin.rest;

import club.tianff.ulogin.logic.ULoginMethods;
import club.tianff.util.restapiresponse.ResponseUtil;
import com.sun.org.apache.xpath.internal.operations.Mod;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Created by tianfei on 2017/8/18.
 */
@RestController
public class UloginRestApi {

    private Map<Integer, Date> sessions = new ConcurrentHashMap<>();

    @Autowired
    ULoginMethods loginMethods;


    public Object register(@RequestParam String nickname,
                           @RequestParam String email,
                           @RequestParam String password,
                           Model model) {


        boolean result = loginMethods.register(nickname,email,password);





        return ResponseUtil.success();
    }


    public Object uLogin() {




        return null;
    }


    public Object uLogout() {

        return null;
    }

    /**
     * 修改非关键用户信息： nickname
     *
     * @return 统一返回结果
     */
    public Object updateUserInfo() {


        return null;
    }

    /**
     * 修改密码
     *
     * @return 统一返回结果
     */
    public Object updatePassword() {


        return null;
    }


}
